﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class per_exchange_huodong : MpageBase
{
    protected DataTable userOrder = null;
    protected void Page_Load(object sender, EventArgs e)
    {

        bindData();
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        bindData();
    }
    protected void timesl_SelectedIndexChanged(object sender, EventArgs e)
    {
        bindData();
    }
    protected void bindData()
    {
        PagedDataSource pds = new PagedDataSource();
        string where = "EndTime>GETDATE()"; //没有过期的
        string sql = "Userid=" + loginUserInfo.Id + " and " + where;
        int totalCount = 0;
        userOrder = BLL.GoldCode.GetPageDT_Where(this.AspNetPager1.CurrentPageIndex - 1, this.AspNetPager1.PageSize, sql, out totalCount);
        if (userOrder != null && userOrder.Rows.Count > 0)
        {
            AspNetPager1.Visible = true;
            AspNetPager1.RecordCount = totalCount;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;

        }
        else
        { AspNetPager1.Visible = false; }
    }
    protected void typesl_SelectedIndexChanged(object sender, EventArgs e)
    {
        bindData();
    }
}